<?php
/* @var $this CreditController */
/* @var $model Credit */

$this->breadcrumbs=array(
	'Credits'=>array('napthecao'),
	'Cộng thêm  Credit',
);

$this->menu=array(
	array('label'=>'List Credit', 'url'=>array('index')),
	array('label'=>'Manage Credit', 'url'=>array('admin')),
);
?>

<h1>Cộng thêm  Credit</h1>


<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'credit-form',
	'enableAjaxValidation'=>false,
)); ?>
<style>
.ui-button{
width:30px;
height:23px;
position:relative;
top:6px;
}
</style>

	<?php echo $form->errorSummary($model); ?>
	<div class="row">
<?php echo $form->labelEx($model,'iduser'); 
	
	
	 echo $form->hiddenField($model,'iduser',array()); 

$this->widget('zii.widgets.jui.CJuiAutoComplete', array(
           'name' => 'Credit[username]',
            'sourceUrl' => array('Credit/SuggestPerson'),
            'value' =>  ($model->username) ? $model->username: $model->username,
            'options' => array(
                'showAnim' => 'fold',
                //remove if you dont need to store the id, like i do...
                'select' => 'js:function(event, ui){ jQuery("#Credit_iduser").val(ui.item["id"]); }'
            ),
            'htmlOptions' => array(
                'style'=>'height: 16px; width: 300px;',
             ),
        ));

	echo $form->error($model,'iduser');
	?>
	</div>


	<div class="row">
		<label>Số Credit</label>
		<?php echo $form->textField($model,'sodu'); ?>
		<?php echo $form->error($model,'sodu'); ?>
	</div>


	<p class="note">Thông tin bắt buộc <span class="required">*</span></p>


	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Tạo Credit' : 'Cập nhật'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->